/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "associatedsequence")
@NamedQueries({
    @NamedQuery(name = "Associatedsequence.findAll", query = "SELECT a FROM Associatedsequence a"),
    @NamedQuery(name = "Associatedsequence.findByIdassociatedsequence", query = "SELECT a FROM Associatedsequence a WHERE a.idassociatedsequence = :idassociatedsequence"),
    @NamedQuery(name = "Associatedsequence.findByAssociatedsequence", query = "SELECT a FROM Associatedsequence a WHERE a.associatedsequence = :associatedsequence")})
public class Associatedsequence implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idassociatedsequence")
    private Integer idassociatedsequence;
    @Column(name = "associatedsequence")
    private String associatedsequence;
    @JoinTable(name = "curatorialassociatedsequence", joinColumns = {
        @JoinColumn(name = "idassociatedsequence", referencedColumnName = "idassociatedsequence")}, inverseJoinColumns = {
        @JoinColumn(name = "idcuratorialelement", referencedColumnName = "idcuratorialelement")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<Curatorialelement> curatorialelementList;
    @JoinTable(name = "occurrenceassociatedsequence", joinColumns = {
        @JoinColumn(name = "idassociatedsequence", referencedColumnName = "idassociatedsequence")}, inverseJoinColumns = {
        @JoinColumn(name = "idoccurrenceelement", referencedColumnName = "idoccurrenceelement")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<Occurrenceelement> occurrenceelementList;

    public Associatedsequence() {
    }

    public Associatedsequence(Integer idassociatedsequence) {
        this.idassociatedsequence = idassociatedsequence;
    }

    public Integer getIdassociatedsequence() {
        return idassociatedsequence;
    }

    public void setIdassociatedsequence(Integer idassociatedsequence) {
        this.idassociatedsequence = idassociatedsequence;
    }

    public String getAssociatedsequence() {
        return associatedsequence;
    }

    public void setAssociatedsequence(String associatedsequence) {
        this.associatedsequence = associatedsequence;
    }

    public List<Curatorialelement> getCuratorialelementList() {
        return curatorialelementList;
    }

    public void setCuratorialelementList(List<Curatorialelement> curatorialelementList) {
        this.curatorialelementList = curatorialelementList;
    }

    public List<Occurrenceelement> getOccurrenceelementList() {
        return occurrenceelementList;
    }

    public void setOccurrenceelementList(List<Occurrenceelement> occurrenceelementList) {
        this.occurrenceelementList = occurrenceelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idassociatedsequence != null ? idassociatedsequence.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Associatedsequence)) {
            return false;
        }
        Associatedsequence other = (Associatedsequence) object;
        if ((this.idassociatedsequence == null && other.idassociatedsequence != null) || (this.idassociatedsequence != null && !this.idassociatedsequence.equals(other.idassociatedsequence))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Associatedsequence[idassociatedsequence=" + idassociatedsequence + "]";
    }

}
